package com.freedom.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.freedom.base.domain.BaseDomain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author freedom
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
public class Department extends BaseDomain implements Serializable {
    private Long id;
    private String name;
    private String intro;
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    private Employee manager;
    private Department parent;
    private String path;
    private Integer state;
    private List<Department> children;


    public Department ( String departmentName ) {
       this.name=departmentName;
    }
}
